//
//  TestController.h
//  AnimatedFlashcards
//
//  Created by Timothy Costa on 10/13/09.
//  Copyright 2009 __MyCompanyName__. All rights reserved.
//

#import <Cocoa/Cocoa.h>

#import "Card.h"
#import "Deck.h"
#import "Results.h"
#import "EditCardController.h"

@class Card;
@class Deck;
@class Results;

@interface TestController : NSObject {
	// State
	BOOL isTesting;
	BOOL allowClicks;
	int currentSide;
	int initialSide;
	BOOL alwaysShowHints;
	NSMutableArray * questionQueue;

	// Output
	NSTextField * side1;
	NSTextField * side2;
	NSTextField * hint;
	NSImage * side1Image;
	NSImage * side2Image;
	
	// Interactors
	NSButton * questionAnswerButton;
	NSButton * hintButton;
	IBOutlet NSMenuItem * menuSide1;
	IBOutlet NSMenuItem * menuSide2;
	IBOutlet NSMenuItem * menuMaintainSelection;
	IBOutlet NSArrayController * deck_cards;
	IBOutlet EditCardController * editCardController;
}
@property IBOutlet BOOL isTesting;
@property IBOutlet BOOL allowClicks;
@property (assign) IBOutlet NSTextField * side1;
@property (assign) IBOutlet NSTextField * side2;
@property (assign) IBOutlet NSTextField * hint;
@property (assign) IBOutlet NSButton * questionAnswerButton;
@property (assign) IBOutlet NSButton * hintButton;

@property (assign) NSMutableArray * questionQueue;
@property (assign) IBOutlet NSImage * side1Image;
@property (assign) IBOutlet NSImage * side2Image;

// Buttons
- (IBAction) dontKnow: (id)sender;
- (IBAction) soSo: (id)sender;
- (IBAction) noProblem: (id)sender;
- (IBAction) toggleSide: (id)sender;

// Menu Items
- (IBAction) testSideClicked: (id)sender;
- (IBAction) hintClicked: (id)sender;

// Instance methods
- (void) scorerClicked: (float) score;
-(void) startTest:(NSMutableArray*)cardsForTest;
-(Card*) randomCard;
-(void) showCard: (Card*)cardToShow;
-(IBAction) openEditCardSheet:(id)sender;
@end
